<include file="public@header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:url('activity/index')}">活动列表</a></li>
			<li><a href="{:url('activity/add')}">添加活动</a></li>
		</ul>
        <form class="well form-inline margin-top-20" method="get" action="{:url('activity/index')}">
        	活动名称：
            <input type="text" class="form-control" name="title" style="width: 150px;" value="{:input('request.title/s','')}" placeholder="请输入活动名称">

            广告位：
            <select name='type' class="form-control">
            	<option value="">请选择状态</option>
            	<option value="1" <if condition="$type eq 1">selected</if>>banner</option>
            	<option value="2" <if condition="$type eq 2">selected</if>>常驻入口</option>
            </select>

            状态：
            <select name='status' class="form-control">
            	<option value="">请选择状态</option>
            	<option value="1" <if condition="$status eq 1">selected</if>>上架</option>
            	<option value="2" <if condition="$status eq 2">selected</if>>下架</option>
            </select>
            <input type="submit" class="btn btn-primary" value="搜索" />
        </form>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th width="80">活动ID</th>
					<th>活动名称</th>
					<th>图标</th>
					<th>广告位</th>
					<th>跳转链接</th>
					<th>开始时间</th>
					<th>结束时间</th>
					<th>状态</th>
					<th width="140">操作</th>
				</tr>
			</thead>
			<tbody>
				<foreach name="list" item="vo">
				<tr>
					<td>{$vo.id}</td>
					<td>{$vo.name}</td>
					<td><img style="height:40px;width: 40px;" src="/upload/{$vo.logo}"></td>

					<td>
						<if condition="$vo.type eq 1">
							<span class="label label-success">banner</span>
						<else />
							<span class="label label-danger">常驻入口</span>
						</if>
					</td>

					<td>{$vo.url}</td>
					<td>{$vo.start_time}</td>
					<td>{$vo.end_time}</td>
					<td>
						<if condition="$vo.status eq 1">
							<span class="label label-success">上架</span>
						<else />
							<span class="label label-danger">下架</span>
						</if>
					</td>

					<td>
						<a href="{:url('activity/add', ['id' => $vo.id])}">编辑</a>
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>